home *** CD-ROM | disk | FTP | other *** search
/ CU Amiga Super CD-ROM 17 / CU Amiga Magazine's Super CD-ROM 17 (1997)(EMAP Images)(GB)[!][issue 1997-12].iso / CUCD / Programming / DiceSource / installer / scripts / install-ppage next >
Text File  |  1991-10-24  |  7KB  |  335 lines

  1. ; script to install PPage
  2.  
  3.     ; set up a error cleanup routine
  4.  
  5. (onerror
  6.     (makeassign "PPageInstCG" (safe))
  7.     (makeassign "PPageInstPgm" (safe))
  8.     (makeassign "PPageInstUtil" (safe))
  9. )
  10.  
  11. (complete 0)
  12.  
  13.     ; just in case the installation was restarted
  14.  
  15. (makeassign "PPageInstCG" (safe))        ; start fresh
  16. (makeassign "PPageInstPgm" (safe))
  17. (makeassign "PPageInstUtil" (safe))
  18.  
  19.     ; see if this is really an update
  20.  
  21. (set is_update 0)
  22. (set ppage_dest (getassign "PPage" "a"))
  23.  
  24.     ; if update, be sure they want program in same place
  25.  
  26. (if ppage_dest
  27.     (if (askbool
  28.             (prompt "Your current copy of Professional Page appears to be located in the drawer named \""
  29.                     ppage_dest
  30.                     "\". Do you want the update installed in that drawer?"
  31.             )
  32.             (help
  33.                 "The installer has determined that you may already have a "
  34.                 "copy of PPage installed on your system. If this is wrong or "
  35.                 "you want the update installed elsewhere, select NO as an "
  36.                 "answer. Otherwise, select YES."
  37.             )
  38.             (default 1)
  39.         )
  40.  
  41.         (set is_update 1)        ; if user wants in same place
  42.  
  43.         (set ppage_dest            ; if user wants in different place
  44.             (tackon
  45.                 (askdir
  46.                     (prompt "In which disk or drawer should Professional Page be installed?")
  47.                     (help @askdir-help)
  48.                     (default @default-dest)
  49.                 )
  50.                 "PPage"
  51.             )
  52.         )
  53.     )
  54. )
  55.  
  56.     ; if not an update, get a location for program
  57.  
  58. (if (not ppage_dest)
  59.     (set ppage_dest
  60.         (tackon
  61.             (askdir
  62.                 (prompt "In which disk or drawer should Professional Page be installed?")
  63.                 (help @askdir-help)
  64.                 (default @default-dest)
  65.             )
  66.             "PPage"
  67.         )
  68.     )
  69. )
  70.  
  71.     ; now lock on to volume 'ppage'
  72.  
  73. (askdisk
  74.     (prompt "Please insert the disk labeled \"Professional Page Program Disk\".")
  75.     (help    "The Professional Page program and other tools will be copied "
  76.             "from the \"Professional Page Program Disk\" into your system.")
  77.     (dest  "PPage")
  78.     (newname "PPageInstPgm")
  79. )
  80.  
  81.     ; make PPage drawer & icon if not there
  82.  
  83. (if (not is_update)
  84.     (makedir ppage_dest (infos))
  85. )
  86.  
  87.     ; at this point we have a valid destination, so we tell installer where
  88.     ; the application will end up so the exit page will be correct -- also,
  89.     ; the installation log file (if any) will be copied to the destination
  90. (set @default-dest ppage_dest)
  91.  
  92. (copyfiles
  93.     (source "PPageInstPgm:PPage")
  94.     (dest ppage_dest)
  95.     (infos)
  96. )
  97.  
  98. (complete 20)
  99.  
  100. (tooltype
  101.     (dest ppage_dest)
  102.     (noposition)
  103. )
  104.  
  105.    ;
  106.    ; these libraries are necessary for PPage, make sure that they are there:
  107.    ;
  108.  
  109. (copylib 
  110.     (source "PPageInstPgm:libs/mathtrans.library")
  111.     (dest "LIBS:")
  112. )
  113.  
  114. (copylib 
  115.     (source "PPageInstPgm:libs/diskfont.library")
  116.     (dest "LIBS:")
  117. )
  118.  
  119.    ;
  120.    ; While we've got this diskette, grab the new paintjet driver in case
  121.    ; he wants it.
  122.  
  123. (if (not (exists "DEVS:printers/HP_PaintJet"))
  124.     (copyfiles
  125.         (prompt
  126.             "If your printer is an HP PaintJet, you will need a printer "
  127.             "driver for it. Please indicate whether or not you want this "
  128.             "printer driver copied to your system.")
  129.         (help @copyfiles-help)
  130.         (source "PPageInstPgm:devs/printers/HP_PaintJet")
  131.         (dest "DEVS:printers")
  132.         (infos)
  133.         (confirm)
  134.     )
  135. )
  136.  
  137. (complete 30)
  138.  
  139.     ; get lock on utility disk
  140.  
  141. (askdisk
  142.     (prompt "Please insert the disk labeled \"Professional Page Fonts & Utilities Disk\".")
  143.     (help    "The \"Professional Page Fonts & Utilities Disk\" contains additional data and fonts usefull to "
  144.             "Professional Page.")
  145.     (dest  "PPageUtil")
  146.     (newname "PPageInstUtil")
  147. )
  148.  
  149. (copyfiles
  150.     (source "PPageInstUtil:Data")
  151.     (dest (tackon ppage_dest "Data"))        ; will make directory
  152.     (all)
  153. )
  154.  
  155. (copyfiles
  156.     (source "PPageInstUtil:MakeFont")
  157.     (dest ppage_dest)
  158.     (infos)
  159. )
  160.  
  161. (tooltype
  162.     (dest (tackon ppage_dest "MakeFont"))
  163.     (noposition)
  164. )
  165.  
  166. (copyfiles
  167.     (source "PPageInstUtil:PPage_Any_Font")
  168.     (dest ppage_dest)
  169. )
  170.  
  171. (complete 40)
  172.  
  173. (set answer1
  174.     (askbool
  175.         (prompt "Should the Tutorial Files be installed?")
  176.         (help
  177.             "The Tutorial files (in conjunction with the tutorial section"
  178.             "of the manual) show how to create a newletter. This may be "
  179.             "helpful to you.")
  180.         (default 1)
  181.     )
  182. )
  183.  
  184. (if answer1
  185.     (copyfiles
  186.         (source "PPageInstUtil:Newsletter")
  187.         (dest (tackon ppage_dest "NewsLetter"))
  188.         (all)
  189.         (infos)
  190.     )
  191. )
  192.  
  193. (complete 50)
  194.  
  195. (set answer1
  196.     (askchoice
  197.         (prompt "Where would you like Professional Page's bitmapped fonts installed?")
  198.         (help    "These fonts are standards for desktop publishing work, but can"
  199.                 "also be used in other Amiga programs.")
  200.         (choices "FONTS: drawer" "ProPage's drawer" "Don't install")
  201.         (default 1)
  202.     )
  203. )
  204.  
  205. (if (= answer1 0)
  206.     (copyfiles
  207.         (source "PPageInstUtil:Fonts")
  208.         (dest "FONTS:")
  209.         (all)
  210.     )
  211. )
  212.  
  213. (if (= answer1 1)
  214.     (
  215.         (copyfiles
  216.             (source "PPageInstUtil:Fonts")
  217.             (dest (tackon ppage_dest "Fonts"))
  218.             (all)
  219.         )
  220.         (textfile
  221.             (dest (tackon ppage_dest "PPageFonts"))
  222.             (append "Echo \"Selecting PPage fonts\" NOLINE\n"
  223.                     "Assign FONTS: \""
  224.                     ppage_dest
  225.                     "/Fonts\"\nEcho \"Done.\"\n"
  226.             )
  227.         )
  228.         (copyfiles
  229.             (source "PPageInstUtil:misc/icons/PPageFonts.info")
  230.             (dest ppage_dest)
  231.         )
  232.             ; **** but what if they have a FONTS disk, hum...
  233.         (set the_fonts (getassign "FONTS" "a"))
  234.         (textfile
  235.             (dest (tackon ppage_dest "AmigaFonts"))
  236.             (append "Echo \"Selecting Amiga fonts\" NOLINE\n"
  237.                     "Assign FONTS: \""
  238.                     the_fonts
  239.                     "\"\nEcho \"Done.\"\n"
  240.             )
  241.         )
  242.         (copyfiles
  243.             (source "PPageInstUtil:misc/icons/AmigaFonts.info")
  244.             (dest ppage_dest)
  245.         )
  246.     )
  247. )
  248.  
  249. (complete 70)
  250.  
  251. (set answerCG
  252.     (askbool
  253.         (prompt "Should the Compugraphic Fonts be installed?")
  254.         (help "These are used to by Professional Page to produce scalable screen fonts.")
  255.         (default 1)
  256.     )
  257. )
  258.  
  259. (if answerCG
  260.     (askdisk
  261.         (prompt "Please insert the disk labeled \"Professional Page Outline Fonts Disk\".")
  262.         (help    "The \"Professional Page Outline Fonts Disk\" disk contains the Compugraphic Fonts.")
  263.         (dest  "CGFonts")
  264.         (newname "PPageInstCG")
  265.     )
  266. )
  267.  
  268. (set the_cache "")
  269.  
  270. (if answerCG
  271.     (
  272.         (copyfiles
  273.             (source "PPageInstCG:")
  274.             (dest (tackon ppage_dest "CGFonts"))
  275.             (all)
  276.         )
  277.         (delete (tackon ppage_dest "CGFonts/disk.info"))
  278.         (rename (tackon ppage_dest "CGFonts/CacheEdit")
  279.                 (tackon ppage_dest "CacheEdit"))
  280.         (rename (tackon ppage_dest "CGFonts/CacheEdit.info")
  281.                 (tackon ppage_dest "CacheEdit.info"))
  282.         (tooltype
  283.             (dest (tackon ppage_dest "CacheEdit"))
  284.             (noposition)
  285.         )
  286.         (set the_cache
  287.             (cat
  288.                 "ASSIGN CGFonts: \"" (tackon ppage_dest "CGFonts") "\"\n"
  289.                 "ASSIGN CGCache: \"" (tackon ppage_dest "CGFonts/CGCache") "\"\n"
  290.             )
  291.         )
  292.     )
  293. )
  294.  
  295. (complete 90)
  296.  
  297.     ; modify S:User-Startup
  298.  
  299. (startup "PPage"
  300.     (prompt
  301.         "Some instructions need to be added to the \"S:user-startup\" "
  302.         "so that your system will be properly configured to use PPage.")
  303.     (help "Do this or PPage won't work!!")
  304.     (command
  305.         "ASSIGN PPage: \"" ppage_dest "\"\n"
  306.         "ASSIGN PPageUtil: \"" ppage_dest "\"\n"
  307.         the_cache
  308.     )
  309. )
  310.  
  311.     ; reinitialize assigns
  312.  
  313. (if (not @pretend)
  314.     (    (makeassign "PPage" ppage_dest)
  315.         (makeassign "PPageUtil" ppage_dest)
  316.         (if answerCG
  317.             (    (makeassign "CGFonts" (tackon ppage_dest "CGFonts"))
  318.                 (makeassign "CGCache" (tackon ppage_dest "CGFonts/CGCache"))
  319.             )
  320.         )
  321.     )
  322. )
  323.  
  324. (complete 100)
  325.  
  326.     ; cleanup
  327.  
  328. (makeassign "PPageInstCG" (safe))
  329. (makeassign "PPageInstPgm" (safe))
  330. (makeassign "PPageInstUtil" (safe))
  331.  
  332.     ; this is not strictly necessary, but doesn't hurt -- there is always
  333.     ; a default (exit) at the end of any script
  334. (exit)
  335.